package 乙级;

import java.math.BigInteger;
import java.util.Scanner;

/**
 * @author mubei
 * @date 2021/8/20
 * @description
 */
public class A除B {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String src = scanner.next();
        int m = scanner.nextInt();
        BigInteger integer = new BigInteger(src);
        BigInteger[] bigIntegers = integer.divideAndRemainder(new BigInteger(m + ""));

        System.out.println(bigIntegers[0]+" "+bigIntegers[1]);


    }

}
